<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@include file="/includes.jsp"%>

<div class="layout">
    <div style="float: right;">
        <table class="details" cellspacing="0">
            <tr>
                <th class="details">Interested Roles</th>
                <td class="details">
                    <logic:iterate name="taskStateMachine" property="interestedRoles" id="role">
                        <html:link action="showNode.do" paramId="nodeId" paramName="role" paramProperty="id">
                            <beans:write name="role" property="name"/><br/>
                        </html:link>
                    </logic:iterate>
                </td>
            </tr>
        </table>
    </div>
    <img src="<html:rewrite page='/icons/task-32x32.png'/>"/><span class="node-name"><beans:write name="taskStateMachine" property="name"/></span>
    <p class="history">
        <span class="history-text">
            <velocityme:markup><beans:write name="taskStateMachine" property="description"/></velocityme:markup>
        </span>
    </p>
    <table class="styled" cellspacing="0">
        <tr>
            <th class="styled">Source</th>
            <th class="styled">Destination</th>
            <th class="styled">Status</th>
            <th class="styled">Owner</th>
            <th class="styled">User</th>
            <th class="styled">Roles</th>
        </tr>
        <logic:iterate name="taskStateMachine" property="transitions" id="transition">
            <tr>
                <td class="styled">
                    <html:link action="showNode.do" paramId="nodeId" paramName="transition" paramProperty="sourceState.id">
                        <beans:write name="transition" property="sourceState.name"/>
                    </html:link>
                </td>
                <td class="styled">
                    <html:link action="showNode.do" paramId="nodeId" paramName="transition" paramProperty="destinationState.id">
                        <beans:write name="transition" property="destinationState.name"/>
                    </html:link>
                </td>
                <td class="styled">
                    <html:link action="showNode.do" paramId="nodeId" paramName="transition" paramProperty="status.id">
                        <beans:write name="transition" property="status.name"/>
                    </html:link>
                </td>
                <td class="styled" style="text-align: center;">
                    <logic:equal name="transition" property="ownerResponsible" value="true">
                        <html:img page="/icons/enabled-16x16.png"/>
                    </logic:equal>
                    <logic:equal name="transition" property="ownerResponsible" value="false">
                        <html:img page="/icons/disabled-16x16.png"/>
                    </logic:equal>
                </td>
                <td class="styled" style="text-align: center;">
                    <logic:equal name="transition" property="userResponsible" value="true">
                        <html:img page="/icons/enabled-16x16.png"/>
                    </logic:equal>
                    <logic:equal name="transition" property="userResponsible" value="false">
                        <html:img page="/icons/disabled-16x16.png"/>
                    </logic:equal>
                </td>
                <td class="styled">
                    <logic:empty name="transition" property="responsibleRoles">
                        &nbsp;
                    </logic:empty>
                    <logic:iterate name="transition" property="responsibleRoles" id="role">
                        <html:link action="showNode.do" paramId="nodeId" paramName="role" paramProperty="id">
                            <beans:write name="role" property="name"/><br/>
                        </html:link>
                    </logic:iterate>
                </td>
            </tr>
        </logic:iterate>
    </table>
</div>
